<?php
/**
 * @name /www/index.php
 * @author Michael Foss <mfoss@clarionsafety.com>
 * @version 2007.07.02
 *
 * This is the home page for the site template.
 */

// Sets up configuration settings and includes libraries.
require_once('_ini.php');

/**
 * Defines preload page functionality;
 * this happens after DefineParams,
 * but before anything else.
 */
function DefinePreload() {
  if (!$_SESSION['userId']){
  	header('location:' . _webroot('/'));
    die();
  }
}

/**
 * Defines page parameters.
 *
 * @param PageParams $p
 */
function DefineParams(&$p) {
  // Define page parameters here.
}

/**
 * Defines custom header content.
 *
 */
function DefineHeader() {
  // Custom HTML info goes here,
  // just before the closing </head> tag.
}

/**
 * Defines page content.
 *
 */
function DefineContent() {
  // Page content goes here.
  $_SESSION['userId'] = 0;
?><h1>Logout</h1>
<p>
  You have been successfully logged out.
</p>
<p>
  For added security, please close your browser.
</p>
<p>
  To login again, click <a href="<?=_webroot('/login_register.php') ?>">here</a>.
</p>
<?
}

// Launches the page; without this, nothing happens.
require_once('_loader.php');